package com.atguigu.demo.customer.mapper;

import com.atguigu.demo.customer.bean.Customer;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
@DS("mysql0212")
public interface CustomerMapper extends BaseMapper<Customer> {

    //#{}  不需要另外加单引 ，半自动， 它会自动判断变量的类型 ，如果是字符串，自动增加单引 ，把一些特殊符号进行转义
    //${}  完全不做任何改动

//    @Insert("insert into customer values(#{customer.id}, #{customer.name},#{customer.age}) ")
//    public void saveCustomer(@Param("customer") Customer customer);


    @Select("select * from customer where id=#{id}")
    @DS("mysql1216")
    public  Customer getCustomerById(@Param("id") String id);
}
